package com.love.cloud.common.core.exception;

import com.love.cloud.common.core.constant.enums.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author
 * @version 1.0
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class BusinessException extends RuntimeException {

	protected Integer code;

	protected String message;

	public BusinessException(Integer code, String message) {
		this.code = code;
		this.message = message;
	}
	public BusinessException(String message) {
		this.code = 1;
		this.message = message;
	}
	public BusinessException(ResultCode resultCode) {
		this.code = resultCode.code();
		this.message = resultCode.message();
	}
}
